js.underas.controller.LinkButton = new Class({
	"Extends":js.underas.controller.Controller
	,"initialize":function(p_label){
		this.parent('li','<a href="#"><label>&nbsp;'+p_label+'&nbsp;</label></a>'); 
		this.getEle().addClass("LinkButton");
	}
	,"setIcon":function(psrc){
		if(!this.getEle('span.iconeinput')){
			this.getEle().getElement('a').appendHTML('<span class="imgI hidden-xs iconeinput glyphicon glyphicon-'+psrc+'"></span>');
		}else{
			var classes = this.getEle().getElement('span.iconeinput').get("class");
			var ns = classes.replace(/glyphicon\-\w+/,"glyphicon-"+psrc);
			this.getEle().getElement('span.iconeinput').erase('class').addClass(ns);
		}
	}
	,"setLabel":function(p_label){
		this.getEle("a label").set("text","&nbsp;"+p_label+"&nbsp;");
	}
	
	,"setEnable":function(on){
		if(on){
			this.getEle().getElement("a").set("disabled",!on).removeClass("Disabled").setStyle("opacity",1);
		}else{
			this.getEle().getElement("a").set("disabled",!on).addClass("Disabled").setStyle("opacity",0.6);
		}
	}
	,"isEnable":function(){
		if(this.getEle().getElement("a").hasClass("Disabled")){
			return false;
		}
		return true;
	}
});

js.underas.controller.Button = new Class({
	"Extends":js.underas.controller.Controller
	,"initialize":function(p_label){
		this.parent('a','<span class="btnLabel cposi_1 cposis">&nbsp;'+p_label+'&nbsp;</span>'); 
		this.getEle().addClass("btn btn-default Button").set("href","#");
	}
	,"setIcon":function(psrc){
		if(!this.getEle('span.iconeinput')){
			this.getEle().appendHTML('<span class="imgI iconeinput glyphicon glyphicon-'+psrc+'"></span>');
		}else{
			var classes = this.getEle('span.iconeinput').get("class");
			var ns = classes.replace(/glyphicon\-\w+/,"glyphicon-"+psrc);
			this.getEle('span.iconeinput').erase('class').addClass(ns);
		}
	}
	,"setLabel":function(p_label){
		this.getEle("span.btnLabel").set("text","&nbsp;"+p_label+"&nbsp;");
	}	
	,"setEnable":function(on){
		if(on){
			this.getEle().set("disabled",!on).removeClass("Disabled").setStyle("opacity",1);
		}else{
			this.getEle().set("disabled",!on).addClass("Disabled").setStyle("opacity",0.6);
		}
	}
	,"isEnable":function(){
		if(this.getEle().hasClass("Disabled")){
			return false;
		}
		return true;
	}
});
